<template>
	<!-- 认证类型选择弹框组件 -->
	<view class="auth-type-pop">
		<u-popup :show="show" mode="bottom" :round="20" bgColor="white" @close="show = false">
			<view class="auth-type-pop-box">
				<view class="auth-type-top-box">
					<text>选择商户类别</text>
					<text>请根据您的证件，选择对应的主体类型</text>
				</view>
				<view class="auth-type-menu-box">
					<view class="auth-type-menu-item" @tap="showAuthAction(1)">
						<text>小微商户</text>
						<text>身份进件</text>
					</view>
					<view class="auth-type-menu-item" @tap="showAuthAction(2)">
						<text>企业商户</text>
						<text>营业执照进件</text>
					</view>
				</view>
				<view class="close-btn" @tap="close">取消</view>
			</view>
		</u-popup>
	</view>
	
</template>

<script setup>
	import { ref } from 'vue'
	// 是否显示弹框
	const show = ref(false) 
	//显示
	const open = () => {
		show.value = true
	}
	//关闭
	const close = () => {
		show.value = false
	}
	//跳转到对应的认证页面
	const showAuthAction = (type)=>{
		if(type == 1){
			uni.navigateTo({
				url:'/pages/auth/idcard-info/idcard-info'
			})
		}
		else{
			uni.navigateTo({
				url:'/pages/auth/enterprise-info/enterprise-info'
			})
		}
	}
	// 暴露子组件的属性/方法给外界调用
	defineExpose({
		open,
		close
	})
</script>

<style lang="scss" scoped>
.auth-type-pop-box{
	background-color: white;
	border-top-left-radius: 20rpx;
	border-top-right-radius: 20rpx;
	.auth-type-top-box{
		display: flex;
		flex-direction: column;
		align-items: center;
		padding: 30rpx;
		font-size: 24rpx;
		color: $xh-subtitle-color;
		border-bottom: 1px solid $xh-line-color;
		text:nth-child(1){
			font-size: 36rpx;
			font-weight: 500;
			margin-bottom: 10rpx;
			color: $xh-title-color;
		}
	}
	.auth-type-menu-box{
		padding: 30rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		border-bottom: 1px solid $xh-line-color;
		.auth-type-menu-item{
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			color: white;
			background-color: $xh-theme-color;
			font-size: 32rpx;
			height: 100rpx;
			border-radius: 50rpx;
			width: 500rpx;
			text:nth-child(2){
				font-size: 24rpx;
				margin-top: 4rpx;
			}
			&:nth-of-type(2){
				margin-top: 20rpx;
			}
		}
	}
	.close-btn{
		height: 90rpx;
		line-height: 90rpx;
		text-align: center;
	}
}
</style>